function fnLogin() {
    var uname = document.getElementById("name").value
    var upwd = document.getElementById("pwd").value
    var rupwd = document.getElementById("rpwd").value
    var uage = document.getElementById("age").value
    var uphone = document.getElementById("tel").value
    var isError= "true";
    var rule = /^[\u4E00-\u9FA5A-Za-z0-9_]{2,15}$/;
    var trule = /^((\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$)$/;
    if (rule.test(uname) == false) {
        alert("用户名格式不正确");
        isError = "false";
        return false;
    } else if (upwd == "") {
        alert("密码不能为空")
        isError = "false";
        return false;
    }else if(upwd != rupwd){
        alert("密码不一致")
        isError = "false";
        return false;
    }else if (uage < 1 || uage > 100) {
        alert("年龄错误")
        isError = "flase";
        return false;
    }else if(trule.test(uphone) == false){
        alert("电话号码错误")
        isError = "false";
        return false;
    }
    document.getElementById("iserror1").value=isError;
    window.alert("注册成功")
}